package cool.webstudy.admin.constant.enums.rescode;

import lombok.extern.slf4j.Slf4j;

/**
 * @author 莫振双
 * @date 2025/4/13 23:56
 * @description: 攻击记录响应码枚举
 */
@Slf4j
public enum AttackRecordResCodeEnum implements BaseResCodeEnum{
    RC_ATTACK_RECORD_INSERT_FAILED("170001","攻击记录插入失败！"),
    RC_ERROR_ATTACK_RECORD_QUERY("170002","查询攻击记录失败！"),
    ;
    String code;
    String msg;
    AttackRecordResCodeEnum(String code, String msg){
        this.code = code;
        this.msg = msg;
    }
    @Override
    public String code() {
        return code;
    }

    @Override
    public String msg() {
        return msg;
    }
    public static AttackRecordResCodeEnum getMsgByCode(String code){
        for (AttackRecordResCodeEnum resCodeEnum : AttackRecordResCodeEnum.values()) {
            if (resCodeEnum.code().equals(code)){
                return resCodeEnum;
            }
        }
        log.error("getMsgByCode 无法获取枚举值");
        return null;
    }
}
